home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / pibcat.arc / PIBCAT.PAS < prev    next >
Pascal/Delphi Source File  |  1989-03-31  |  11KB  |  172 lines

  1. (*$V-,R-,S-,B-,I-,F+*)
  2. PROGRAM PibCat;
  3.  
  4. (*----------------------------------------------------------------------*)
  5. (*                                                                      *)
  6. (*    Program: PIBCAT --- Catalog files on a disk.                      *)
  7. (*                                                                      *)
  8. (*    Author:  Philip R. Burns.                                         *)
  9. (*                                                                      *)
  10. (*    Version: 1.7.   April 1, 1989.                                    *)
  11. (*                                                                      *)
  12. (*    Usage:                                                            *)
  13. (*                                                                      *)
  14. (*       PIBCAT v /c=format /e=filespec /f=filespec /i=indent /l        *)
  15. (*                /m=margin /n /o=filename /p=pagesize /s=filename      *)
  16. (*               /t=timezone /x /2                                      *)
  17. (*                                                                      *)
  18. (*                                                                      *)
  19. (*            v               volume (drive letter) to catalog          *)
  20. (*                            (default is current drive)                *)
  21. (*                            If given as ?, this text is displayed.    *)
  22. (*            /a              Requests that PibCat output be appended   *)
  23. (*                            to the file specified by "/o=".  Default  *)
  24. (*                            is to overwrite the the output file.      *)
  25. (*            /c=format       Produce condensed listing suitable for    *)
  26. (*                            input to a database manager or sorting    *)
  27. (*                            program.  Two formats are available:  a   *)
  28. (*                            columnar format specified as "/c=column"  *)
  29. (*                            or a comma-delimited format specified as  *)
  30. (*                            "/c=comma".  Specifying "/c" without a    *)
  31. (*                            format produces the columnar format.      *)
  32. (*                            This option overrides all other formatting*)
  33. (*                            options.                                  *)
  34. (*            /e=filespec     DOS file spec to match when listing       *)
  35. (*                            entries in .ARC/.DWC/.LBR/.MD/.PAK/.ZIP/  *)
  36. (*                            .ZOO files                                *)
  37. (*                            (default is *.* -- list all entries).     *)
  38. (*            /f=filespec     DOS file spec to match when listing files *)
  39. (*                            (default is *.* -- list all files)        *)
  40. (*            /i=indent       # columns to space for library entries    *)
  41. (*                            (default is 0)                            *)
  42. (*            /l              display long file names in .ZOO and .MD   *)
  43. (*                            files (default is to display short file   *)
  44. (*                            names only)                               *)
  45. (*            /m=margin       left margin to leave (default is 0)       *)
  46. (*            /n              expand libraries after main catalog       *)
  47. (*                            listing rather than immediately after     *)
  48. (*                            library file name (default is to expand   *)
  49. (*                            immediately following file name).         *)
  50. (*            /o=filename     write catalog listing to file "filename"  *)
  51. (*                            (default is "CATALOG.LIS")                *)
  52. (*            /p=pagesize     paginate listing using "pagesize" lines   *)
  53. (*                            (default is no pagination)                *)
  54. (*            /s=filename     write status information to "filename"    *)
  55. (*                            (default is DOS standard output)          *)
  56. (*            /t=timezone     number of hours local time lags/leads     *)
  57. (*                            Greenwich Mean Time [GMT] (default is 7)  *)
  58. (*            /x              don't list library file contents          *)
  59. (*                            (default is to list contents)             *)
  60. (*            /2              Opens files without SHARE for DOS v2.x    *)
  61. (*                            compatibility (default is to open files   *)
  62. (*                            with share for DOS v3.1 and above)        *)
  63. (*                                                                      *)
  64. (*    Aborting:  Hit ^C to abort catalog listing.                       *)
  65. (*                                                                      *)
  66. (*    Output:                                                           *)
  67. (*                                                                      *)
  68. (*       For each selected file, the file name, size in bytes, and time *)
  69. (*       and date of creation are displayed.  The same information is   *)
  70. (*       given for members of .ARC, .DWC, .LBR, .MD, and .ZOO files.    *)
  71. (*                                                                      *)
  72. (*    Restrictions:                                                     *)
  73. (*                                                                      *)
  74. (*       None.  I contribute this program and all source code to the    *)
  75. (*       public domain.                                                 *)
  76. (*                                                                      *)
  77. (*       I do ask as a matter of courtesy that you give me credit if    *)
  78. (*       you use this code in your own applications.                    *)
  79. (*                                                                      *)
  80. (*    Acknowledgments:                                                  *)
  81. (*                                                                      *)
  82. (*       The archive search code is based upon TPARCV.PAS written by    *)
  83. (*       Michael Quinlan and ARCV.ASM written by Vern Buerg.            *)
  84. (*                                                                      *)
  85. (*       The library search code is based upon LU.PAS written by        *)
  86. (*       Steve Freeman.                                                 *)
  87. (*                                                                      *)
  88. (*       Stephen Falatko suggested and coded the enhancement to list    *)
  89. (*       the contents of .ARC, .LBR files immediately following their   *)
  90. (*       appearance in the main catalog listing.  I've altered the      *)
  91. (*       display to make it easier to pick those entries which are .ARC *)
  92. (*       and .LBR contents.                                             *)
  93. (*                                                                      *)
  94. (*       Dave Seidman provided a mechanism for getting the volume label *)
  95. (*       under MS DOS 2.x.                                              *)
  96. (*                                                                      *)
  97. (*       The format for the .ZOO files was taken from the "C" source    *)
  98. (*       code to ZOO written by Rahul Dhesi.                            *)
  99. (*                                                                      *)
  100. (*       The format for the .MD files was extracted from the code       *)
  101. (*       provided by Mike Davenport.                                    *)
  102. (*                                                                      *)
  103. (*       The format for the .DWC files was extracted from the code      *)
  104. (*       provided by Dean W. Cooper for his DWC program.                *)
  105. (*                                                                      *)
  106. (*       The format for the .ZIP files comes from the APPNOTE.TXT file  *)
  107. (*       provided by Phil Katz with his PKZIP/PKUNZIP utilities, and    *)
  108. (*       from Ken Brown's ZIPV program (written in C).                  *)
  109. (*                                                                      *)
  110. (*       The format for the extended .ARC headers comes from technical  *)
  111. (*       note TM0401.TXT provided by SEA.                               *)
  112. (*                                                                      *)
  113. (*       The format for the .LZH and .LZS files comes from a note by    *)
  114. (*       Robert A. Freed.                                               *)
  115. (*                                                                      *)
  116. (*    Note:                                                             *)
  117. (*                                                                      *)
  118. (*      The routines for processing the various library files are all   *)
  119. (*      extremely similar.  I could have merged them into one big       *)
  120. (*      routine to avoid the duplicate code.  However, I felt it was    *)
  121. (*      a better idea to leave them separate, even with the extensive   *)
  122. (*      code duplication, so that you could extract the ones you wanted *)
  123. (*      without having to wade through stuff unrelated to the library   *)
  124. (*      format of interest to you.                                      *)
  125. (*                                                                      *)
  126. (*----------------------------------------------------------------------*)
  127.  
  128.                                    (* Global declarations *)
  129. (*$I PIBCAT.GLO    *)
  130.                                    (* General service subroutines *)
  131. (*$I PIBCATS1.PAS  *)
  132. (*$I PIBCATS2.PAS  *)
  133.                                    (* Initialization and display  *)
  134. (*$I PIBCATS3.PAS  *)
  135.  
  136. (*----------------------------------------------------------------------*)
  137. (*          Include code to process library files.                      *)
  138. (*----------------------------------------------------------------------*)
  139.  
  140.                                    (* .ARC/.PAK display routines    *)
  141. (*$I PIBCATA.PAS *)
  142.                                    (* .DWC display routines         *)
  143. (*$I PIBCATD.PAS *)
  144.                                    (* .ZIP display routines         *)
  145. (*$I PIBCATK.PAS *)
  146.                                    (* .LBR display routines         *)
  147. (*$I PIBCATL.PAS *)
  148.                                    (* .MD display routines          *)
  149. (*$I PIBCATM.PAS *)
  150.                                    (* .LHZ display routines         *)
  151. (*$I PIBCATY.PAS *)
  152.                                    (* .ZOO display routines         *)
  153. (*$I PIBCATZ.PAS *)
  154.  
  155. (*----------------------------------------------------------------------*)
  156. (*          File display, sorting, listing control routines.            *)
  157. (*----------------------------------------------------------------------*)
  158.  
  159. (*$I PIBCATS4.PAS *)
  160.  
  161. (*---------------------- Main Program of PIBCAT ------------------------*)
  162.  
  163. BEGIN (* PibCat *)
  164.                                    (* Initialize program.  If initialization *)
  165.                                    (* goes OK, then perform cataloguing.     *)
  166.    IF Initialize THEN
  167.       Perform_Cataloguing;
  168.                                    (* Close output file and terminate.       *)
  169.    Terminate;
  170.  
  171. END   (* PibCat *).
  172.